package com.simple.dispatcher.db;

import java.sql.Connection;
import java.sql.SQLException;

import org.apache.commons.dbcp.BasicDataSource;

public class DataBaseUtils {
	
	private static final DataBaseUtils instance = new DataBaseUtils();
	
	public static Connection getConnection() throws SQLException {
		return instance.ds.getConnection();
	}
	
	private final BasicDataSource ds;
	
	private DataBaseUtils() {
		ds = new BasicDataSource();
		ds.setDriverClassName("com.mysql.jdbc.Driver");
		ds.setUsername("root");
		ds.setPassword("wa830901");
		ds.setUrl("jdbc:mysql://localhost:3306/simplesina?characterEncoding=utf8");
	}
}
